<template>
  <div>
    <div style="width:100%;display:flex;color:#fff" class="divBox">
      <div style="width: 70%;">
        <a-card title="指令配置" style="width: 100%;text-align: center">
          <div class="configInstructionBox">
            <span style="font-size:16px;margin-right:20px">{{ instructionType }}:</span>
            <div class="instructionValueBox" v-if="instructionType=='通联业务处理器L星弹链路频点控制'">
              <!-- <resourcePool1 ref="pool1" :group="true" :data="JSON.stringify(subData)" :small="3" /> -->
              <div class="subData" @mousedown="boxdown" @mouseup="boxup" @mouseleave="boxleave">
                <div v-for="item in subData" :key="item.id" class="SZLBQBox">
                  <!-- <a-popover title="详情" v-if="!item.disabled"> -->
                  <div
                      @mouseenter="subenter(item)"
                      @mousedown="subdown(item)"
                      :class="!item.disabled ? (item.check ? 'oncheck' : 'offcheck') : 'disabledStyle'"
                  >{{ item.id }}
                  </div>

                </div>
              </div>
            </div>

            <div class="instructionValueBox" v-if="instructionType=='通联业务处理器Ka星弹链路频点控制'">
              <!-- <resourcePool1 ref="pool1" :group="true" :data="JSON.stringify(subData)" :small="3" /> -->
              <div class="subData" @mousedown="boxdown" @mouseup="boxup" @mouseleave="boxleave">
                <div v-for="item in subData" :key="item.id" class="SZLBQBox">
                  <!-- <a-popover title="详情" v-if="!item.disabled"> -->
                  <div
                      @mouseenter="subenter(item)"
                      @mousedown="subdown(item)"
                      :class="!item.disabled ? (item.check ? 'oncheck' : 'offcheck') : 'disabledStyle'"
                  >{{ item.id }}
                  </div>

                </div>
              </div>
            </div>

            <div
                class="instructionValueBox"
            >
              <a-form-model layout="inline" :model="formInline"
                            v-if="instructionType=='加解密退网用户控制'||instructionType=='加解密入网用户控制'"
              >
                <a-form-model-item>
                  <a-textarea :rows="4" @blur="changeBllid(formInline.instructionValue,68,`${instructionType}`)"
                              :maxLength="68" v-model="formInline.instructionValue"
                              placeholder="请输入34个十六进制数"></a-textarea>
                </a-form-model-item>
              </a-form-model>
              <a-form-model layout="inline" :model="formInline"
                            v-if="instructionType=='通联业务处理器接口及加解密模式控制'"
              >
                <a-form-model-item>
                  <a-input @blur="changeBllid(formInline.instructionValue,8,`${instructionType}`)" :maxLength="8"
                           v-model="formInline.instructionValue" placeholder="请输入4个十六进制数"></a-input>
                </a-form-model-item>
              </a-form-model>
              <a-form-model layout="inline" :model="formInline" v-if="instructionType=='通用指令'"
              >
                <a-form-model-item>
                  <a-input @blur="changeBllid(formInline.instructionValue,8,`${instructionType}`)" :maxLength="8"
                           v-model="formInline.instructionValue" placeholder="请输入4个十六进制数"></a-input>
                </a-form-model-item>
                <a-form-model-item>
                  <a-textarea style="width:300px" :rows="3"
                              @blur="changeBllid(formInline.instructionValue1,68,`${instructionType}`)" :maxLength="68"
                              v-model="formInline.instructionValue1" placeholder="请输入34个十六进制数"></a-textarea>
                </a-form-model-item>
              </a-form-model>
<!--              <a-form-model layout="inline" :model="formInline"-->
<!--                            v-if="instructionType=='通联业务处理器Ka星弹链路频点控制'"-->
<!--              >-->
<!--                <a-form-model-item>-->
<!--                  <a-input @blur="changeBllid(formInline.instructionValue,12,`${instructionType}`)" :maxLength="12"-->
<!--                           v-model="formInline.instructionValue" placeholder="请输入6个十六进制数"></a-input>-->
<!--                </a-form-model-item>-->
<!--              </a-form-model>-->
              <a-form-model :rules="rules" v-if="instructionType=='星弹直传参数设置指令(SPU)'" layout="inline"
                            :model="formInline">
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="接收拦截目标信息的导弹数量">
                      <a-input-number :max="32" v-model="formInline.ballNum" placeholder="请输入..."></a-input-number>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <div>
                  <a-row v-for="(item,indx) in formInline.ballNum" :key="indx+'lanjie'">
                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'识别码'">
                        <a-input
                            :maxLength="4"
                            @blur="changeBllid(params[indx].id1,4,`导弹${(indx+1)}识别码`)"
                            v-model="params[indx].id1" placeholder="请输入2个的十六进制数"/>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'自定义配置区'">
                        <a-input
                            :maxLength="12"
                            @blur="changeBllid(params[indx].area1,12,`导弹${(indx+1)}自定义配置区`)"
                            v-model="params[indx].area1" placeholder="请输入6个十六进制数"></a-input>
                      </a-form-model-item>
                    </a-col>

                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'拦截目标编号1'">
                        <a-input
                            :maxLength="4"
                            @blur="changeBllid(params[indx].no1,4,`导弹${(indx+1)}拦截目标编号1`)"
                            v-model="params[indx].no1" placeholder="请输入2个的十六进制数"></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'拦截目标编号2'">
                        <a-input
                            :maxLength="4"
                            @blur="changeBllid(params[indx].no2,4,`导弹${(indx+1)}拦截目标编号2`)"
                            v-model="params[indx].no2" placeholder="请输入2个的十六进制数"></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'的L/Ka标识'">
                        <a-select v-model="params[indx].LKa" default-value="11" style="width: 180px">
                          <a-select-option value="AA">
                            KA标识
                          </a-select-option>
                          <a-select-option value="11">
                            L标识
                          </a-select-option>

                        </a-select>
                        <!-- <a-input v-model="params[indx].LKa" placeholder="请输入..."></a-input> -->
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                </div>

              </a-form-model>
              <a-form-model v-if="instructionType=='星车周期交互启动指令(SPU)'" layout="inline" :model="formInline">
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="武器平台识别码1" prop="id1">
                      <a-input
                          :maxLength="4"
                          @blur="changeBllid(formInline.id1,4,`武器平台识别码1`)" v-model="formInline.id1"
                          placeholder="请输入2个的十六进制数"></a-input>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="星车交互启动指令码1">
                      <a-input
                          :maxLength="4"
                          @blur="changeBllid(formInline.in1,4,`星车交互启动指令码1`)" v-model="formInline.in1"
                          placeholder="请输入2个的十六进制数"></a-input>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="武器平台识别码2">
                      <a-input
                          :maxLength="4"
                          @blur="changeBllid(formInline.id2,4,`武器平台识别码2`)" v-model="formInline.id2"
                          placeholder="请输入2个的十六进制数"></a-input>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="星车交互启动指令码2">
                      <a-input
                          :maxLength="4"
                          @blur="changeBllid(formInline.in2,4,`星车交互启动指令码2`)" v-model="formInline.in2"
                          placeholder="请输入2个的十六进制数"></a-input>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="武器平台识别码3">
                      <a-input
                          :maxLength="4"
                          @blur="changeBllid(formInline.id3,4,`武器平台识别码3`)" v-model="formInline.id3"
                          placeholder="请输入2个的十六进制数"></a-input>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="星车交互启动指令码3">
                      <a-input
                          :maxLength="4"
                          @blur="changeBllid(formInline.in3,4,`星车交互启动指令码3`)" v-model="formInline.in3"
                          placeholder="请输入2个的十六进制数"></a-input>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="武器平台识别码4">
                      <a-input
                          :maxLength="4"
                          @blur="changeBllid(formInline.id4,4,`武器平台识别码4`)" v-model="formInline.id4"
                          placeholder="请输入2个的十六进制数"></a-input>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="星车交互启动指令码4">
                      <a-input
                          :maxLength="4"
                          @blur="changeBllid(formInline.in4,4,`星车交互启动指令码4`)" v-model="formInline.in4"
                          placeholder="请输入2个的十六进制数"></a-input>
                    </a-form-model-item>
                  </a-col>
                </a-row>
              </a-form-model>
              <a-form-model layout="inline" v-if="instructionType=='星弹直传启动终止指令(SPU)'" :model="formInline">
                <a-row>
                  <a-form-model-item label="当前要启动直传的导弹总数量">
                    <a-input-number v-model="formInline.totalNum" placeholder="请输入"></a-input-number>
                  </a-form-model-item>
                </a-row>

                <a-form-model-item :key="index" v-for="(item,index) in formInline.totalNum"
                                   :label="'导弹'+(index+1)+'识别码'">
                  <a-input
                      :maxLength="4"
                      @blur="changeBllid(idCa[index],4,`导弹${(index+1)}识别码`)"
                      v-model="idCa[index]"
                      placeholder="请输入2个的十六进制数"></a-input>
                </a-form-model-item>
              </a-form-model>
              <!-- <a-form-model layout="inline" :model="formInline" v-if="instructionType=='通联综合控制器导弹识别码设置指令'">
               <a-form-model-item>
                 <a-input v-model="formInline.instructionValue" placeholder="请输入..."></a-input>
               </a-form-model-item>
               <a-form-model-item>
                 <a-input v-model="formInline.instructionValue1" placeholder="请输入..."></a-input>
               </a-form-model-item>
             </a-form-model> -->
              <a-form-model layout="inline" :model="formInline"
                            v-if="instructionType=='通联综合控制器星地对时'||instructionType=='星车对时指令TISU端'">
                <a-form-model-item label="指令长度">
                  <a-input
                      :maxLength="2"
                      @blur="changeBllid(formInline.instructionValue,2,`指令长度`)"
                      @change="changeValue(formInline.instructionValue)" v-model="formInline.instructionValue"
                      placeholder="请输入一个十六进制数"></a-input>
                </a-form-model-item>
                <a-form-model-item label="指令内容">
                  <a-input
                      :maxLength="value1Length"
                      @blur="changeBllid(formInline.instructionValue1,value1Length,`指令内容`)"
                      v-model="formInline.instructionValue1" placeholder="请输入"></a-input>
                </a-form-model-item>
              </a-form-model>
              <a-form-model layout="inline" :model="formInline"
                            v-if="instructionType=='通联综合控制器导弹识别码设置指令'">
                <a-form-model-item label="有效填充1">
                  <a-select v-model="formInline.instructionValue" style="width: 180px">
                    <a-select-option value="20">
                      20
                    </a-select-option>
                    <a-select-option value="1C">
                      1C
                    </a-select-option>

                  </a-select>
                </a-form-model-item>
                <a-form-model-item label="导弹识别码">
                  <a-input
                      :maxLength="4"
                      @blur="changeBllid(formInline.instructionValue1,4,`导弹识别码`)"
                      v-model="formInline.instructionValue1" placeholder="请输入2个十六进制数"></a-input>
                </a-form-model-item>
              </a-form-model>
              <a-form-model layout="inline" v-if="instructionType=='星车对时指令TSPU端'" :model="formInline">
                <a-form-model-item label="指控车识别码">
                  <a-input
                      :maxLength="4"
                      @blur="changeBllid(formInline.carName,4,`指控车识别码`)"
                      v-model="formInline.carName" placeholder="请输入2个十六进制数"></a-input>
                </a-form-model-item>

              </a-form-model>
              <a-form-model
                  layout="inline"
                  :model="formInline"
                  :label-col="labelCol"
                  :wrapper-col="wrapperCol"
                  v-if="instructionType=='通联业务处理器星指链路模式控制'"
              >
                <a-row>
                  <a-col :span="8">
                    <a-form-model-item label="上行速率模式">
                      <a-select v-model="formInline.uplinkRateMode" default-value="00" style="width: 180px">
                        <a-select-option value="0000">上行640kbps</a-select-option>
                        <a-select-option value="1111">上行1280kbps</a-select-option>
                      </a-select>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="8">
                    <a-form-model-item label="下行速率模式">
                      <a-select v-model="formInline.downlinkRateMode" default-value="0000" style="width: 180px">
                        <a-select-option value="0000">下行3.2Mbps</a-select-option>
                        <a-select-option value="1111">下行6.4Mbps</a-select-option>
                      </a-select>
                    </a-form-model-item>
                  </a-col>

                </a-row>

                <a-row>
                  <a-col :span="8">
                    <a-form-model-item label="上行跳频控制">
                      <a-select v-model="formInline.uplinkFrequencyHoppingControl" default-value="0000"
                                style="width: 180px">
                        <a-select-option value="0000">上行定频（960MHz）</a-select-option>
                        <a-select-option value="1111">上行跳频</a-select-option>
                      </a-select>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="8">
                    <a-form-model-item label="下行跳频控制">
                      <a-select v-model="formInline.downlinkFrequencyHoppingControl" default-value="0000"
                                style="width: 180px">
                        <a-select-option value="0000">下行定频（960MHz）</a-select-option>
                        <a-select-option value="1111">下行跳频</a-select-option>
                      </a-select>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="8">
                    <a-form-model-item label="工作模式">
                      <a-select default-value="00" v-model="formInline.workingMode" style="width: 180px">
                        <a-select-option value="00">交换工作模式</a-select-option>
                        <a-select-option value="FF">自测环境模式</a-select-option>
                      </a-select>
                    </a-form-model-item>
                  </a-col>
                </a-row>
              </a-form-model>
              <a-form-model
                  v-if="instructionType=='通联业务处理器L星弹链路模式控制'||instructionType=='通联业务处理器Ka星弹链路模式控制'"
                  layout="inline" :model="formInline">
                <a-form-model-item label="速率模式">
                  <a-select v-model="formInline.rateMode" default-value="00" style="width: 160px">
                    <a-select-option value="00">下行3ksps</a-select-option>
                    <a-select-option value="11">下行12ksps</a-select-option>
                    <a-select-option value="22">下行24ksps</a-select-option>
                    <a-select-option value="33">下行48ksps</a-select-option>
                    <a-select-option value="44">下行96ksps</a-select-option>
                  </a-select>
                </a-form-model-item>
                <a-form-model-item label="下行频点号">
                  <a-select v-model="formInline.downlinkFrequencyPoint" default-value="00" style="width: 180px">
                    <a-select-option value="00">下行频点0（935MHz）</a-select-option>
                    <a-select-option value="11">下行频点1（940MHz）</a-select-option>
                    <a-select-option value="22">下行频点2（945MHz）</a-select-option>
                    <a-select-option value="33">下行频点3（950MHz）</a-select-option>
                    <a-select-option value="44">下行频点4（955MHz）</a-select-option>
                    <a-select-option value="55">下行频点5（960MHz）</a-select-option>
                    <a-select-option value="66">下行频点6（965MHz）</a-select-option>
                    <a-select-option value="77">下行频点7（970MHz）</a-select-option>
                    <a-select-option value="88">下行频点8（975MHz）</a-select-option>
                    <a-select-option value="99">下行频点9（980MHz）</a-select-option>
                    <a-select-option value="AA">下行频点10（985MHz）</a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-form-model>
              <a-form-model layout="inline" :model="formInline"
                            v-if="instructionType=='电磁感知处理器L可控接收机控制指令'">
                <a-form-model-item label="任务号">
                  <a-input
                      :maxLength="8"
                      @blur="changeBllid(formInline.taskNo,8,`任务号`)" style="width: 120px" v-model="formInline.taskNo"
                      placeholder="请输入4个十六进制数"></a-input>
                </a-form-model-item>
                <a-form-model-item label="滤波器选通">
                  <a-input-number
                      style="width: 120px"
                      v-model="formInline.waveFilter"
                      placeholder="请输入滤波器选通最大2047"
                      :max="2047"
                  />
                </a-form-model-item>
                <a-form-model-item label="L可控接收机">
                  <a-select v-model="formInline.LControllableReceiver" default-value="L可控接收机1"
                            style="width: 160px">
                    <a-select-option :value="0">L可控接收机1</a-select-option>
                    <a-select-option :value="1">L可控接收机2</a-select-option>
                  </a-select>
                </a-form-model-item>
              </a-form-model>
            </div>


            <div
                class="instructionValueBox"
                v-if="instructionType.indexOf('加指令')!=-1||instructionType.indexOf('减指令')!=-1"
            >
              <a-input
                  v-if="instructionType.indexOf('频率')!=-1"
                  type="number"
                  v-model="instructionValue"
                  placeholder="Basic usage"
                  style="width: 200px;"
                  :min="0"
                  :max="14"
                  suffix="M"
              ></a-input>
              <a-input
                  v-else
                  type="number"
                  v-model="instructionValue"
                  placeholder="Basic usage"
                  style="width: 200px;"
                  :min="0"
                  :max="14"
              ></a-input>
              <a-icon
                  type="caret-up"
                  v-if="instructionType.indexOf('加指令')!=-1"
                  style="font-size:20px;margin-left:20px;cursor: pointer;"
                  @click="handleAddValue"
              />
              <a-icon
                  type="caret-down"
                  v-if="instructionType.indexOf('减指令')!=-1"
                  style="font-size:20px;margin-left:20px;cursor: pointer;"
                  @click="handleReduceValue"
              />
            </div>
          </div>
        </a-card>
        <!-- <div style="width: 25%">
           <a-descriptions title="遥测信息" style="width: 25%；color:#fff" size='small' :column='1'>

                 <a-descriptions-item :label="item.label" v-for="item in descList" :key='label'>
                 {{item.value}}
                </a-descriptions-item>
            </a-descriptions>
        </div> -->

        <a-card title="指令配置结果" style="width: 100%;text-align: center;">
          <div>
            <div>
              确定{{ instructionType }}是:
              <p
                  v-if="instructionType.indexOf('加指令')!=-1||instructionType.indexOf('减指令')!=-1"
              >{{ instructionValue }}</p>
              </p>
              <p v-if="instructionType=='通联业务处理器L星弹链路频点控制'">
                频点号：
                <a-textarea :rows="2" v-model="pointInfo" style="width:550px"/>
              </p>
              <p v-if="instructionType=='通联业务处理器Ka星弹链路频点控制'">
                频点号：
                <a-textarea :rows="2" v-model="pointInfo" style="width:550px"/>
              </p>
              <div class="instructionValueBox" v-if="instructionType=='电磁感知处理器L可控接收机控制指令'">
                <a-form-model layout="inline" :model="formInline">
                  <a-form-model-item label="任务号">
                    <a-input read-only style="width: 120px" v-model="formInline.taskNo"
                             placeholder="请输入任务号"></a-input>
                  </a-form-model-item>
                  <a-form-model-item label="滤波器选通">
                    <a-input-number
                        style="width: 120px"
                        v-model="formInline.waveFilter"
                        placeholder="请输入滤波器选通最大2047"
                        :max="2047"
                        read-only
                    />
                  </a-form-model-item>
                  <a-form-model-item label="L可控接收机">
                    <a-select disabled v-model="formInline.LControllableReceiver" default-value="L可控接收机1"
                              style="width: 160px">
                      <a-select-option :value="0">L可控接收机1</a-select-option>
                      <a-select-option :value="1">L可控接收机2</a-select-option>
                    </a-select>
                  </a-form-model-item>
                </a-form-model>
              </div>
              <a-form-model layout="inline" :model="formInline" v-if="instructionType=='通用指令'"
              >
                <a-form-model-item>
                  <a-input read-only :maxLength="8" v-model="formInline.instructionValue"
                           placeholder="请输入4个十六进制数"></a-input>
                </a-form-model-item>
                <a-form-model-item>
                  <a-textarea style="width:300px" :rows="3" read-only :maxLength="68"
                              v-model="formInline.instructionValue1" placeholder="请输入34个十六进制数"></a-textarea>
                </a-form-model-item>
              </a-form-model>
              <a-form-model layout="inline" :model="formInline"
                            v-if="instructionType=='通联业务处理器接口及加解密模式控制'"
              >
                <a-form-model-item>
                  <a-input read-only :maxLength="8" v-model="formInline.instructionValue"
                           placeholder="请输入4个十六进制数"></a-input>
                </a-form-model-item>
              </a-form-model>
              <div
                  class="instructionValueBox"
                  v-if="instructionType=='加解密退网用户控制'||instructionType=='加解密入网用户控制'"
              >
                <a-form-model layout="inline" :model="formInline">
                  <a-form-model-item>
                    <a-textarea :rows="4" read-only v-model="formInline.instructionValue"
                                placeholder="请输入..."></a-textarea>
                  </a-form-model-item>
                </a-form-model>
              </div>
              <div
                  class="instructionValueBox"
                  v-if="instructionType=='通联业务处理器L星弹链路模式控制'||instructionType=='通联业务处理器Ka星弹链路模式控制'"
              >
                <a-form-model layout="inline" :model="formInline">
                  <a-form-model-item label="速率模式">
                    <a-select disabled v-model="formInline.rateMode" default-value="00" style="width: 160px">
                      <a-select-option value="00">下行3ksps</a-select-option>
                      <a-select-option value="11">下行12ksps</a-select-option>
                      <a-select-option value="22">下行24ksps</a-select-option>
                      <a-select-option value="33">下行48ksps</a-select-option>
                      <a-select-option value="44">下行96ksps</a-select-option>
                    </a-select>
                  </a-form-model-item>
                  <a-form-model-item label="下行频点号">
                    <a-select v-model="formInline.downlinkFrequencyPoint" default-value="00" style="width: 180px">
                      <a-select-option value="00">下行频点0（935MHz）</a-select-option>
                      <a-select-option value="11">下行频点1（940MHz）</a-select-option>
                      <a-select-option value="22">下行频点2（945MHz）</a-select-option>
                      <a-select-option value="33">下行频点3（950MHz）</a-select-option>
                      <a-select-option value="44">下行频点4（955MHz）</a-select-option>
                      <a-select-option value="55">下行频点5（960MHz）</a-select-option>
                      <a-select-option value="66">下行频点6（965MHz）</a-select-option>
                      <a-select-option value="77">下行频点7（970MHz）</a-select-option>
                      <a-select-option value="88">下行频点8（975MHz）</a-select-option>
                      <a-select-option value="99">下行频点9（980MHz）</a-select-option>
                      <a-select-option value="AA">下行频点10（985MHz）</a-select-option>
                    </a-select>
                  </a-form-model-item>
                </a-form-model>
              </div>
              <a-form-model v-if="instructionType=='星弹直传参数设置指令(SPU)'" layout="inline" :model="formInline">
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="接收拦截目标1信息的导弹数量">
                      <span style="color:#fff"> {{ formInline.ballNum }}</span>
                      <!-- <a-input-number read-only :max='32' v-model="formInline.ballNum" placeholder="请输入..."></a-input-number> -->
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <div>
                  <a-row v-for="(item,indx) in formInline.ballNum" :key="indx+'lanjie'">
                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'识别码'">
                        <a-input read-only v-model="params[indx].id1" placeholder="请输入..."></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'自定义配置区'">
                        <a-input read-only v-model="params[indx].area1" placeholder="请输入..."></a-input>
                      </a-form-model-item>
                    </a-col>

                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'拦截目标编号1'">
                        <a-input read-only v-model="params[indx].no1" placeholder="请输入..."></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'拦截目标编号2'">
                        <a-input read-only v-model="params[indx].no2" placeholder="请输入..."></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="12">
                      <a-form-model-item :label="'导弹'+(indx+1)+'的L/Ka标识'">
                        <a-select disabled v-model="params[indx].LKa" default-value="11" style="width: 180px">
                          <a-select-option value="AA">
                            KA标识
                          </a-select-option>
                          <a-select-option value="11">
                            L标识
                          </a-select-option>

                        </a-select>
                        <!-- <a-input v-model="params[indx].LKa" placeholder="请输入..."></a-input> -->
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                </div>

              </a-form-model>
              <a-form-model v-if="instructionType=='星车周期交互启动指令(SPU)'" layout="inline" :model="formInline">
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="武器平台识别码1">
                      <a-input read-only v-model="formInline.id1" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="星车交互启动指令码1">
                      <a-input read-only v-model="formInline.in1" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="武器平台识别码2">
                      <a-input read-only v-model="formInline.id2" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="星车交互启动指令码2">
                      <a-input read-only v-model="formInline.in2" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="武器平台识别码3">
                      <a-input read-only v-model="formInline.id3" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="星车交互启动指令码3">
                      <a-input read-only v-model="formInline.in3" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="武器平台识别码4">
                      <a-input read-only v-model="formInline.id4" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="星车交互启动指令码4">
                      <a-input read-only v-model="formInline.in4" placeholder="请输入..."></a-input>
                    </a-form-model-item>
                  </a-col>
                </a-row>
              </a-form-model>
              <a-form-model layout="inline" v-if="instructionType=='星弹直传启动终止指令(SPU)'" :model="formInline">
                <a-row>
                  <a-form-model-item label="当前要启动直传的导弹总数量">
                          <span style="color:#fff">
                            {{ formInline.totalNum }}
                          </span>
                    <!-- <a-input-number v-model="formInline.totalNum" placeholder="请输入"></a-input-number> -->
                  </a-form-model-item>
                </a-row>

                <a-form-model-item :key="index" v-for="(item,index) in formInline.totalNum"
                                   :label="'导弹'+(index+1)+'识别码'">
                  <a-input read-only v-model="idCa[index]" placeholder="请输入"></a-input>
                </a-form-model-item>
              </a-form-model>
              <div class="instructionValueBox" v-if="instructionType=='通联综合控制器导弹识别码设置指令'">
                <a-form-model layout="inline" :model="formInline">
                  <a-form-model-item label="有效填充1">
                    <a-input read-only v-model="formInline.instructionValue" placeholder="请输入..."></a-input>
                  </a-form-model-item>
                  <a-form-model-item label="导弹识别码">
                    <a-input read-only v-model="formInline.instructionValue1" placeholder="请输入..."></a-input>
                  </a-form-model-item>
                </a-form-model>
              </div>
              <div class="instructionValueBox"
                   v-if="instructionType=='星车对时指令TISU端'||instructionType=='通联综合控制器星地对时'">
                <a-form-model layout="inline" :model="formInline">
                  <a-form-model-item label="指令长度">
                    <a-input read-only v-model="formInline.instructionValue" placeholder="请输入..."></a-input>
                  </a-form-model-item>
                  <a-form-model-item label="指令内容">
                    <a-input read-only v-model="formInline.instructionValue1" placeholder="请输入..."></a-input>
                  </a-form-model-item>
                </a-form-model>
              </div>
              <a-form-model layout="inline" v-if="instructionType=='星车对时指令TSPU端'" :model="formInline">
                <a-form-model-item label="指控车识别码">
                  <a-input v-model="formInline.carName" placeholder="请输入..."></a-input>
                </a-form-model-item>

              </a-form-model>
              <div class="instructionValueBox" v-if="instructionType=='通联业务处理器星指链路模式控制'">
                <a-form-model
                    layout="inline"
                    :model="formInline"
                    :label-col="labelCol"
                    :wrapper-col="wrapperCol"
                >
                  <a-row>
                    <a-col :span="8">
                      <a-form-model-item label="上行速率模式">
                        <a-select disabled v-model="formInline.uplinkRateMode" default-value="00" style="width: 180px">
                          <a-select-option value="0000">上行640kbps</a-select-option>
                          <a-select-option value="1111">上行1280kbps</a-select-option>
                        </a-select>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="8">
                      <a-form-model-item label="下行速率模式">
                        <a-select disabled v-model="formInline.downlinkRateMode" default-value="0000"
                                  style="width: 180px">
                          <a-select-option value="0000">下行3.2Mbps</a-select-option>
                          <a-select-option value="1111">下行6.4Mbps</a-select-option>
                        </a-select>
                      </a-form-model-item>
                    </a-col>

                  </a-row>

                  <a-row>
                    <a-col :span="8">
                      <a-form-model-item label="上行跳频控制">
                        <a-select disabled v-model="formInline.uplinkFrequencyHoppingControl" default-value="0000"
                                  style="width: 180px">
                          <a-select-option value="0000">上行定频（960MHz）</a-select-option>
                          <a-select-option value="1111">上行跳频</a-select-option>
                        </a-select>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span="8">
                      <a-form-model-item label="下行跳频控制">
                        <a-select v-model="formInline.downlinkFrequencyHoppingControl" disabled default-value="0000"
                                  style="width: 180px">
                          <a-select-option value="0000">下行定频（960MHz）</a-select-option>
                          <a-select-option value="1111">下行跳频</a-select-option>
                        </a-select>
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                  <a-row>
                    <a-col :span="8">
                      <a-form-model-item label="工作模式">
                        <a-select disabled default-value="00" v-model="formInline.workingMode" style="width: 180px">
                          <a-select-option value="00">交换工作模式</a-select-option>
                          <a-select-option value="FF">自测环境模式</a-select-option>
                        </a-select>
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                </a-form-model>
              </div>
            </div>
            <a-button
                type="primary"
                @click="generateInstructionContent()"
            >生成指令内容
            </a-button>
          </div>
        </a-card>
      </div>
      <div style="width: 30%">
        <a-descriptions title="遥测信息" style="width: 25%；color:#fff" size="small" :column="1">

          <a-descriptions-item :label="item.label" v-for="item in descList" :key="item.label">
            {{ item.value }}
          </a-descriptions-item>
        </a-descriptions>
      </div>


    </div>
  </div>
</template>

<script>
import { Turns } from '@/utils/util'
import { httpAction, getAction } from '@/api/manage'
import resourcePool1 from '../../antiInterferenceStrategy/components/modules/resourcePool1.vue'

export default {
  components: { resourcePool1 },
  props: ['instructionType'],
  data() {
    let checkId1 = (rule, value, callback) => {
      const regex = /^[0-9A-Fa-f]{4}$/
      if (value === '') {
        callback('输入的字符串不能为空')
      } else {
        if (regex.test(value)) {
          callback()
        } else {
          console.log(value, 'value')
          callback('输入的字符串不是一个有效的4位十六进制数')
        }
      }

    }
    return {
      url: {
        configInstruction: '/grid/nmcPackageInfo/serializeDefaultValue2',
      },
      subData: [],
      value1Length: 0,
      idCa: [],
      params: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}],
      formInline: {
        uplinkRateMode: '0000',
        downlinkRateMode: '0000',
        uplinkFrequencyHoppingControl: '0000',
        downlinkFrequencyHoppingControl: '0000',
        workingMode: '00',
        LControllableReceiver: 0,
        downlinkFrequencyPoint: '00',
        rateMode: '00'
      },
      instructionValue: undefined,
      lastItemId: 0, //上次选中的节点Id
      isDrop: false, //是否正在拖拽
      checkGroup: [],
      checkGroup1: [],
      checkNos: [],
      lsArr: [],
      lsArrS: [],
      flag: true,
      pointInfo: '',
      labelCol: { span: 16 },
      wrapperCol: { span: 8 },
      descList: [
        { label: '本振编号', value: '5' },
      ],
      rules: {},
      mappingList: [
        { label: 'L可控接收机1本振加指令', value: '59L可控接收机1本振加指令', configList: [{ label: '59-本振值' }] },
        {
          label: '电磁感知处理器L可控接收机控制指令',
          value: '60可控接收机滤波器控制指令',
          configList: [{ label: '60-操作uid号' }, { label: '60-开关组码字' }, { label: '60-衰减值码字' },]
        },
        {
          label: '通联业务处理器L星弹链路频点控制',
          value: '61L星弹上行链路数字滤波器控制指令',
          configList: [{ label: '60-操作uid号' }, { label: '60-开关组码字' }, { label: '60-衰减值码字' },]
        },
        {
          label: '星弹直传参数设置指令(SPU)',
          value: '66星弹直传参数设置指令',
          configList: [{ label: '66-接收拦截目标信息的导弹数量' }, { label: '66-导弹信息组' }]
        },
        {
          label: '星车周期交互启动指令(SPU)',
          value: '64星车周期交互启动指令',
          configList: [{ label: '64-武器平台识别码1' }, { label: '64-星车交互启动指令码1' }, { label: '64-武器平台识别码2' }, { label: '64-星车交互启动指令码2' }, { label: '64-武器平台识别码3' }, { label: '64-星车交互启动指令码3' }, { label: '64-武器平台识别码4' }, { label: '64-星车交互启动指令码4' },]
        },
        {
          label: '星弹直传启动终止指令(SPU)',
          value: '65星弹直传启动终止指令',
          configList: [{ label: '65-当前要启动直传的导弹总数量' }, { label: '65-导弹识别码组' }]
        },
        { label: 'L可控接收机1本振减指令', value: '67L可控接收机1本振减指令', configList: [{ label: '67-本振值' }] },
        { label: 'L可控接收机2本振加指令', value: '68L可控接收机2本振加指令', configList: [{ label: '68-本振值' }] },
        { label: 'L可控接收机2本振减指令', value: '69L可控接收机2本振减指令', configList: [{ label: '69-本振值' }] },
        { label: 'Ka接收机1频率加指令', value: '70Ka接收机1频率加指令', configList: [{ label: '70-频率值' }] },
        { label: 'Ka接收机2频率加指令', value: '71Ka接收机2频率加指令', configList: [{ label: '71-频率值' }] },
        { label: 'Ka接收机3频率加指令', value: '72Ka接收机3频率加指令', configList: [{ label: '72-频率值' }] },
        { label: 'Ka接收机1频率减指令', value: '73Ka接收机1频率减指令', configList: [{ label: '73-频率值' }] },
        { label: 'Ka接收机2频率减指令', value: '74Ka接收机2频率减指令', configList: [{ label: '74-频率值' }] },
        { label: 'Ka接收机3频率减指令', value: '75Ka接收机3频率减指令', configList: [{ label: '75-频率值' }] },
        { label: 'Ka上变频器1频率加指令', value: '76Ka上变频器1频率加指令', configList: [{ label: '76-频率值' }] },
        { label: 'Ka上变频器2频率加指令', value: '77Ka上变频器2频率加指令', configList: [{ label: '77-频率值' }] },
        { label: 'Ka上变频器3频率加指令', value: '78Ka上变频器3频率加指令', configList: [{ label: '78-频率值' }] },
        { label: 'Ka上变频器4频率加指令', value: '79Ka上变频器4频率加指令', configList: [{ label: '79-频率值' }] },
        { label: 'Ka上变频器1频率减指令', value: '80Ka上变频器1频率减指令', configList: [{ label: '80-频率值' }] },
        { label: 'Ka上变频器2频率减指令', value: '81Ka上变频器2频率减指令', configList: [{ label: '81-频率值' }] },
        { label: 'Ka上变频器3频率减指令', value: '82Ka上变频器3频率减指令', configList: [{ label: '82-频率值' }] },
        { label: 'Ka上变频器4频率减指令', value: '83Ka上变频器4频率减指令', configList: [{ label: '83-频率值' }] },
        {
          label: '通联业务处理器L星弹链路模式控制',
          value: '84通联业务处理器L星弹链路模式控制',
          configList: [{ label: '84-频点' }, { label: '84-速率' }]
        },
        {
          label: '通联业务处理器Ka星弹链路模式控制',
          value: '85通联业务处理器Ka星弹链路模式控制',
          configList: [{ label: '85-频点' }, { label: '85-速率' }]
        },
        {
          label: '通联业务处理器星指链路模式控制',
          value: '86通联业务处理器星指链路模式控制',
          configList: [{ label: '86-跳频控制' }, { label: '86-工作模式' }, { label: '86-速率模式' }]
        },
        {
          label: '通联业务处理器接口及加解密模式控制',
          value: '87通联业务处理器接口及加解密模式控制',
          configList: [{ label: '87-填充区间' }]
        },
        {
          label: '通联业务处理器Ka星弹链路频点控制',
          value: '88通联业务处理器Ka星弹链路频点控制',
          configList: [{ label: '88-填充区间' }]
        },
        //89未对
        {
          label: '通联综合控制器星地对时',
          value: '89通联综合控制器星地对时',
          configList: [{ label: '89-指令长度' }, { label: '89-指令内容' }]
        },
        {
          label: '通联综合控制器导弹识别码设置指令',
          value: '90通联综合控制器导弹识别码设置指令',
          configList: [{ label: '90-有效码字填充1' }, { label: '90-导弹识别码' }]
        },
        { label: '星车对时指令TSPU端', value: '91星车对时指令TSPU端', configList: [{ label: '91-指挥车识别码' }] },
        { label: '加解密入网用户控制', value: '92加解密入网用户控制', configList: [{ label: '92-填充' }] },
        { label: '加解密退网用户控制', value: '93加解密退网用户控制', configList: [{ label: '93-填充' }] },
        { label: '通用指令', value: '94通用指令', configList: [{ label: '94-填充1' }, { label: '94-填充2' },] },
        {
          label: '星车对时指令TISU端',
          value: '97星车对时指令TISU端',
          configList: [{ label: '97-指令长度' }, { label: '97-指令内容' },]
        },

      ]

    }
  },
  watch: {
    instructionType(val) {
      if (val == '通联综合控制器星地对时') {
        this.formInline.instructionValue = '04'
        this.formInline.instructionValue1 = '04550000'
      } else if (val == '星车对时指令TISU端') {
        this.formInline.instructionValue = '04'
        this.formInline.instructionValue1 = '04AA0000'
      }
    }
  },
  mounted() {
    for (let i = 0; i < 128; i++) { //频点选择块
      this.subData.push({ id: i, disabled: false, check: false })
    }
  },
  methods: {
    changeBllid(val, type, text) {
      var level = type
      var reg = new RegExp('^[A-Fa-f0-9]{' + level + '}$')
      if (reg.test(val)) {
        this.flag = true
        return
      } else {
        this.flag = false
        this.$message.error(text + `请输入${type / 2}个十六进制数`)
        return
      }
    },
    emptyData() {
      this.subData.forEach(i => {
        i.check = false
      })
      this.formInline = {
        uplinkRateMode: '0000',
        downlinkRateMode: '0000',
        uplinkFrequencyHoppingControl: '0000',
        downlinkFrequencyHoppingControl: '0000',
        workingMode: '00',
        LControllableReceiver: 0,
        downlinkFrequencyPoint: '00',
        rateMode: '00'
      },
          this.idCa = []
      this.instructionValue = undefined
      this.pointInfo = ''
      this.params = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]

    },
    boxdown: function () {
      //鼠标按下开始拖选
      this.isDrop = true
    },
    subenter: function (item) {
      //拖选中子元素
      if (this.isDrop) {
        if (this.lastItemId != item.id) {
          var min = this.lastItemId <= item.id ? this.lastItemId : item.id
          var max = this.lastItemId < item.id ? item.id : this.lastItemId
          if (this.lastItemId - item.id < 0) {
            //正方向
            for (var i = min; i < Math.abs(this.lastItemId - item.id) + min; i++) {
              this.subData[i].check = !this.subData[i].check
            }
          } else {
            //反方向
            for (var i = max - 1; i > min - 1; i--) {
              this.subData[i].check = !this.subData[i].check
            }
          }
          this.lastItemId = item.id
        }
      }
    },
    subdown: function (item) {
      if (item.disabled) return
      //单个选中子元素(一次选中6个)
      this.lastItemId = item.id
      item.check = !item.check //单个
      if (this.group) {
        let d = []
        let c = this.subData
        for (let i = 0; i < c.length; i += 6) {
          d.push(c.slice(i, i + 6))
        }
        this.checkGroup = []
        d.forEach((el, index) => {
          let temp = el.find((e) => e.id == item.id)
          if (temp) {
            el.forEach((i) => {
              i.check = item.check //6个一起
            })
          }
        })
        d.forEach((c, index) => {
          if (c[0].check) {
            this.checkGroup.push(index)
          }
        })
      } else {
        if (item.check) {
          this.checkNos.push(item.id)
        } else {
          this.checkNos = this.checkNos.filter((i) => i != item.id)
        }
      }
    },
    subUp: function (item) {

      //鼠标抬起取消拖选
      this.isDrop = false
    },
    boxup: function () {
      //鼠标抬起取消拖选
      this.isDrop = false
      let arr = []
      this.subData.forEach(i => {
        if (i.check) {
          arr.push(i.id)
        }
      })
      this.pointInfo = arr.join(',')
    },
    boxleave: function () {
      //当鼠标移出区域块时，视为取消拖选
      this.isDrop = false
    },

    handleAddValue() {
      this.instructionValue += 1
    },
    handleReduceValue() {
      this.instructionValue -= 1
    },
    changeValue(val) {
      // console.log(Number(val) ,'val')
      let length = parseInt(val, 16)
      this.value1Length = length * 2
    },
    generateInstructionContent() {
      let data
      let selectIns = this.mappingList.find(i => i.label == this.instructionType)

      if (this.instructionType == '通联业务处理器L星弹链路频点控制') {
        if (this.pointInfo.split(',').length != 32) {
          this.$message.error(`请选择32个频点号，当前已选择${this.pointInfo.split(',').length}个`)
          return
        } else {
          let aaa = this.pointInfo.split(',')
          var newArray = aaa.map(function (index) {
            return Number(index).toString(16).padStart(2, 0)
          })
          data = {
            'packageCode': '61L星弹上行链路数字滤波器控制指令',
            'serializeItemDtoList': [
              {
                'packageGridCode': '61-数字滤波器信息',
                'packageGridValue': newArray.join('')
              }
            ]
          }
        }
      } else if (this.instructionType == '通联业务处理器Ka星弹链路频点控制') {
        if (this.pointInfo.split(',').length != 8) {
          this.$message.error(`请选择8个频点号，当前已选择${this.pointInfo.split(',').length}个`)
          return
        }
        let aaa = this.pointInfo.split(',')
        var newArray = aaa.map(function (index) {
          return Number(index).toString(16).padStart(2, 0)
        })
        data = {
          'packageCode': '88通联业务处理器Ka星弹链路频点控制',
          'serializeItemDtoList': [
            {
              'packageGridCode': '88-填充区间',
              'packageGridValue': newArray.join('')
            }
          ]
        }
      } else {
        // 下面的验证方法不能验证-通联业务处理器L星弹链路频点控制
        if (!this.flag) {
          this.$message.error('输入参数不对！')
          return
        }
        let arr = [
          'L可控接收机1本振加指令', 'L可控接收机1本振减指令',
          'L可控接收机2本振加指令', 'L可控接收机2本振减指令',
          'Ka接收机1频率加指令', 'Ka接收机2频率加指令', 'Ka接收机3频率加指令',
          'Ka接收机1频率减指令', 'Ka接收机2频率减指令', 'Ka接收机3频率减指令',
          'Ka上变频器1频率加指令', 'Ka上变频器2频率加指令', 'Ka上变频器3频率加指令', 'Ka上变频器4频率加指令',
          'Ka上变频器1频率减指令', 'Ka上变频器2频率减指令', 'Ka上变频器3频率减指令', 'Ka上变频器4频率减指令'
        ]
        data = { 'packageCode': selectIns.value }
        if (arr.indexOf(selectIns.label) != -1) {
          data.serializeItemDtoList = [
            {
              'packageGridCode': selectIns.configList[0].label,
              'packageGridValue': Number(this.instructionValue).toString(16)
            }
          ]
        } else if (selectIns.label == '星弹直传参数设置指令(SPU)') {
          let str = ''
          if (!this.flag) {
            this.$message.error('输入参数不对！')
            return
          }
          let dataList = this.params.filter(item => !item == '' && !item == '' && ![undefined, 'undefined', null, 'null', [], '[]', {}, '{}'].includes(JSON.stringify(item)))
          if (!dataList.length) {
            this.$message.error('请输入导弹信息')
            return
          }
          dataList.forEach(i => {
            if (i != {}) {
              str += (i.id1 + i.area1 + i.no1 + i.no2 + i.LKa)
            }
          })
          data.serializeItemDtoList = [
            {
              'packageGridCode': selectIns.configList[0].label,
              'packageGridValue': this.formInline.ballNum
            },
            {
              'packageGridCode': selectIns.configList[1].label,
              'packageGridValue': str
            },]

        } else if (selectIns.label == '星弹直传启动终止指令(SPU)') {
          let str = ''
          if (!this.flag) {
            this.$message.error('输入参数不对！')
            return
          }
          // let dataList=this.idCa.filter(item => !item == '' && !item == "" && ![undefined, 'undefined', null, 'null', [], '[]', {}, '{}'].includes(JSON.stringify(item)));
          if (!this.idCa.length) {
            this.$message.error('请输入导弹识别码')
            return
          }
          this.idCa.forEach(i => {
            str += (i)
          })
          data.serializeItemDtoList = [
            {
              'packageGridCode': selectIns.configList[0].label,
              'packageGridValue': this.formInline.totalNum
            },
            {
              'packageGridCode': selectIns.configList[1].label,
              'packageGridValue': str
            },]

        } else if (selectIns.label == '星车周期交互启动指令(SPU)') {
          if (!this.flag) {
            this.$message.error('输入参数不对！')
            return
          }
          data.serializeItemDtoList = [
            {
              'packageGridCode': selectIns.configList[0].label,
              'packageGridValue': this.formInline.id1
            },
            {
              'packageGridCode': selectIns.configList[1].label,
              'packageGridValue': this.formInline.in1
            },
            {
              'packageGridCode': selectIns.configList[2].label,
              'packageGridValue': this.formInline.id2
            }, {
              'packageGridCode': selectIns.configList[3].label,
              'packageGridValue': this.formInline.in2
            }, {
              'packageGridCode': selectIns.configList[4].label,
              'packageGridValue': this.formInline.id3
            }, {
              'packageGridCode': selectIns.configList[5].label,
              'packageGridValue': this.formInline.in3
            }, {
              'packageGridCode': selectIns.configList[6].label,
              'packageGridValue': this.formInline.id4
            }, {
              'packageGridCode': selectIns.configList[7].label,
              'packageGridValue': this.formInline.in4
            },
          ]
        } else if (selectIns.label == '通联业务处理器L星弹链路模式控制' || selectIns.label == '通联业务处理器Ka星弹链路模式控制') {
          data.serializeItemDtoList = [
            {
              'packageGridCode': selectIns.configList[1].label,
              'packageGridValue': this.formInline.rateMode
            },
            {
              'packageGridCode': selectIns.configList[0].label,
              'packageGridValue': this.formInline.downlinkFrequencyPoint
            },
          ]
        } else if (selectIns.label == '星车对时指令TSPU端') {
          data.serializeItemDtoList = [
            {
              'packageGridCode': selectIns.configList[0].label,
              'packageGridValue': this.formInline.carName
            },
          ]
        } else if (selectIns.label == '加解密入网用户控制' || selectIns.label == '加解密退网用户控制') {
          data.serializeItemDtoList = [
            {
              'packageGridCode': selectIns.configList[0].label,
              'packageGridValue': this.formInline.instructionValue
            },
            // {
            //   "packageGridCode": selectIns.configList[1].label,
            //   "packageGridValue":this.formInline.instructionValue1
            // },
          ]
        } else if (selectIns.label == '通联综合控制器导弹识别码设置指令' || selectIns.label == '星车对时指令TISU端' || selectIns.label == '通联综合控制器星地对时' || selectIns.label == '通用指令') {
          data.serializeItemDtoList = [
            {
              'packageGridCode': selectIns.configList[0].label,
              'packageGridValue': this.formInline.instructionValue
            },
            {
              'packageGridCode': selectIns.configList[1].label,
              'packageGridValue': this.formInline.instructionValue1
            },
          ]
        } else if (selectIns.label == '电磁感知处理器L可控接收机控制指令') {
          data.serializeItemDtoList = [
            {
              'packageGridCode': selectIns.configList[0].label,
              'packageGridValue': this.formInline.taskNo
            },
            {
              'packageGridCode': selectIns.configList[1].label,
              'packageGridValue': this.formInline.waveFilter
            },
            {
              'packageGridCode': selectIns.configList[2].label,
              'packageGridValue': this.formInline.LControllableReceiver
            },
          ]
        } else if (selectIns.label == '通联业务处理器接口及加解密模式控制' || selectIns.label == '通联业务处理器Ka星弹链路频点控制') {
          // if(this.flag){
          //     this.$message.error('输入参数不对！')
          //     return
          // }
          data.serializeItemDtoList = [
            {
              'packageGridCode': selectIns.configList[0].label,
              'packageGridValue': this.formInline.instructionValue
            },
          ]
        } else if (selectIns.label == '通联业务处理器星指链路模式控制') {
          data.serializeItemDtoList = [
            {
              'packageGridCode': selectIns.configList[0].label,
              'packageGridValue': Turns(this.formInline.uplinkFrequencyHoppingControl + this.formInline.downlinkFrequencyHoppingControl, 16)
            },
            {
              'packageGridCode': selectIns.configList[1].label,
              'packageGridValue': this.formInline.workingMode
            },
            {
              'packageGridCode': selectIns.configList[2].label,
              'packageGridValue': Turns(this.formInline.uplinkRateMode + this.formInline.downlinkRateMode, 16)
            },
          ]
        }

      }
      let dataflag = true
      data.serializeItemDtoList.forEach(i => {
        if (!i.packageGridValue) {
          dataflag = false
        }
      })
      if (!dataflag) {
        this.$message.error('请输入所有参数！')
        return
      }
      httpAction(this.url.configInstruction, data, 'post').then(res => {
        //  console.log(res,'ressssss=========')

        this.$emit('setInstructionContent', res.result, selectIns.value)
        //传给父组件instructionContent
      })

    },
  }
}
</script>
<style>
.divBox .ant-descriptions-title {
  color: #fff !important;
  margin-top: 10px;
}

.divBox .ant-descriptions-item > span {
  font-size: 16px;
}
</style>
<style lang="less" scoped>

.instructionValueBox .ant-input-number .ant-input-number-handler-wrap {
  display: none !important;
  margin: 0;
}

.subData {
  width: 100%;
  display: flex;
  flex-wrap: wrap;

  .SZLBQBox {
    width: 40px;
    height: 40px;
    line-height: 40px;
    user-select: none;
    // border: 1px solid #ad1616;
    .offcheck,
    .oncheck,
    .disabledStyle {
      line-height: 40px;
    }
  }
}

.offcheck,
.oncheck,
.disabledStyle {
  width: 100%;
  height: 100%;
  border: 1px solid #7e7979;
  margin: -1px 0 0 -1px;
  text-align: center;
}

.offcheck {
  color: #000;
  background: #f51616;
}

.disabledStyle {
  color: #898383;
  // background: #868686;
  background: linear-gradient(45deg,
  rgba(117, 117, 117, 0.6) 0,
  rgba(117, 117, 117, 0.6) 10%,
  rgba(42, 44, 43, 1) 10%,
  rgba(42, 44, 43, 1) 20%,
  rgba(117, 117, 117, 0.6) 20%,
  rgba(117, 117, 117, 0.6) 30%,
  rgba(42, 44, 43, 1) 30%,
  rgba(42, 44, 43, 1) 40%,
  rgba(117, 117, 117, 0.6) 40%,
  rgba(117, 117, 117, 0.6) 50%,
  rgba(42, 44, 43, 1) 50%,
  rgba(42, 44, 43, 1) 60%,
  rgba(117, 117, 117, 0.6) 60%,
  rgba(117, 117, 117, 0.6) 70%,
  rgba(42, 44, 43, 1) 70%,
  rgba(42, 44, 43, 1) 80%,
  rgba(117, 117, 117, 0.6) 80%,
  rgba(117, 117, 117, 0.6) 90%,
  rgba(42, 44, 43, 1) 90%,
  rgba(42, 44, 43, 1) 100%);
}

.oncheck {
  color: #000;
  background: #36f73f;
}
</style>
